import xadmin
from orders.models import OrderInfo, Goods, OrderGoods, RecommendedIntegral, IntegralPipelining
from xadmin import views


# 订单基本信息
class OrderInfoXadmin(object):
    list_display = ['order_id', 'user', 'address', 'total_count', 'total_amount',
                    'status', 'order_Time', 'pay_Time', 'completeTime', ]
    model_icon = 'fa fa-child'


# 订单商品列表
class GoodsXadmin(object):
    list_display = ['order', 'url', 'name', 'count', 'description', 'price', 'add_time']
    model_icon = 'fa fa-paw'


# 订单详情
class OrderGoodsXadmin(object):
    list_display = ['order', 'sku', 'count', 'price', 'add_time']
    model_icon = 'fa fa-paw'


# 总积分表
class RecommendedIntegralXadmin(object):
    list_display = ['user', 'total_integral', 'consumption_integral', 'add_Time', 'modify_time']
    model_icon = 'fa fa-paw'


# 积分流水表
class IntegralPipeliningXadmin(object):
    list_display = ['user', 'get_integral', 'integral_source', 'detail', 'add_Time', 'modify_time']
    model_icon = 'fa fa-paw'


# 用户每日总积分
class EveryDayIntegralXadmin(object):
    list_display = ['user', 'everyday_integral', 'add_Time', 'modify_time']
    model_icon = 'fa fa-paw'


xadmin.site.register(OrderInfo, OrderInfoXadmin)
xadmin.site.register(Goods, GoodsXadmin)
xadmin.site.register(OrderGoods, OrderGoodsXadmin)
xadmin.site.register(RecommendedIntegral, RecommendedIntegralXadmin)
xadmin.site.register(IntegralPipelining, IntegralPipeliningXadmin)
# xadmin.site.register(EveryDayIntegral, EveryDayIntegralXadmin)
